<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('account', 20)
                ->index('account')
                ->default('')
                ->comment('账号');

            $table->string('pwd', 200)
                ->default('')
                ->comment('密码');

            $table->string('nick_name', 20)
                ->index('nick_name')
                ->default('')
                ->comment('昵称');

            $table->unsignedTinyInteger('type')
                ->default(1)
                ->comment('登陆设备类型 1 web 2 mobile');

            $table->unsignedTinyInteger('status')
                ->default(1)
                ->comment('状态 1 正常 2 禁用');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
